//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.beetl.sql.gen;

import org.beetl.sql.clazz.kit.StringKit;

public class Attribute {
    private String name;
    private String colName;
    private int size;
    private boolean isNullable;
    private String javaType;
    private boolean isId;
    private boolean isAuto;
    private String comment;
    private String dictName;
    private String varDictName;

    public String getMethodName() {
        return this.name.length() > 1 && Character.isUpperCase(this.name.charAt(1)) ? this.name : StringKit.toUpperCaseFirstOne(this.name);
    }

    public String getName() {
        return this.name;
    }

    public String getColName() {
        return this.colName;
    }

    public int getSize() {
        return this.size;
    }

    public boolean isNullable() {
        return this.isNullable;
    }

    public String getJavaType() {
        return this.javaType;
    }

    public boolean isId() {
        return this.isId;
    }

    public boolean isAuto() {
        return this.isAuto;
    }

    public String getComment() {
        return this.comment;
    }

    public void setName(final String name) {
        this.name = name;
    }

    public void setColName(final String colName) {
        this.colName = colName;
    }

    public void setSize(final int size) {
        this.size = size;
    }

    public void setNullable(final boolean isNullable) {
        this.isNullable = isNullable;
    }

    public void setJavaType(final String javaType) {
        this.javaType = javaType;
    }

    public void setId(final boolean isId) {
        this.isId = isId;
    }

    public void setAuto(final boolean isAuto) {
        this.isAuto = isAuto;
    }

    public void setComment(final String comment) {
        this.comment = comment;
    }

    public String getDictName() {
        return dictName;
    }

    public void setDictName(String dictName) {
        this.dictName = dictName;
    }
    public String getVarDictName() {
        return varDictName;
    }
    public void setVarDictName(String varDictName) {this.varDictName = varDictName;}


    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof Attribute)) {
            return false;
        } else {
            Attribute other = (Attribute)o;
            if (!other.canEqual(this)) {
                return false;
            } else if (this.getSize() != other.getSize()) {
                return false;
            } else if (this.isNullable() != other.isNullable()) {
                return false;
            } else if (this.isId() != other.isId()) {
                return false;
            } else if (this.isAuto() != other.isAuto()) {
                return false;
            } else {
                Object this$name = this.getName();
                Object other$name = other.getName();
                if (this$name == null) {
                    if (other$name != null) {
                        return false;
                    }
                } else if (!this$name.equals(other$name)) {
                    return false;
                }

                Object this$colName = this.getColName();
                Object other$colName = other.getColName();
                if (this$colName == null) {
                    if (other$colName != null) {
                        return false;
                    }
                } else if (!this$colName.equals(other$colName)) {
                    return false;
                }

                Object this$javaType = this.getJavaType();
                Object other$javaType = other.getJavaType();
                if (this$javaType == null) {
                    if (other$javaType != null) {
                        return false;
                    }
                } else if (!this$javaType.equals(other$javaType)) {
                    return false;
                }

                Object this$comment = this.getComment();
                Object other$comment = other.getComment();
                if (this$comment == null) {
                    if (other$comment != null) {
                        return false;
                    }
                } else if (!this$comment.equals(other$comment)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof Attribute;
    }

    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        result = result * 59 + this.getSize();
        result = result * 59 + (this.isNullable() ? 79 : 97);
        result = result * 59 + (this.isId() ? 79 : 97);
        result = result * 59 + (this.isAuto() ? 79 : 97);
        Object $name = this.getName();
        result = result * 59 + ($name == null ? 43 : $name.hashCode());
        Object $colName = this.getColName();
        result = result * 59 + ($colName == null ? 43 : $colName.hashCode());
        Object $javaType = this.getJavaType();
        result = result * 59 + ($javaType == null ? 43 : $javaType.hashCode());
        Object $comment = this.getComment();
        result = result * 59 + ($comment == null ? 43 : $comment.hashCode());
        return result;
    }

    public String toString() {
        return "Attribute(name=" + this.getName() + ", colName=" + this.getColName() + ", size=" + this.getSize() + ", isNullable=" + this.isNullable() + ", javaType=" + this.getJavaType() + ", isId=" + this.isId() + ", isAuto=" + this.isAuto() + ", comment=" + this.getComment() + ")";
    }
}
